Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unit test and rename FirstPlugin #335

Merged
merged 2 commits into from
Oct 18, 2018

Conversation

davidrevoledo
Copy link
Contributor

Description

As we move from a list to a concurrent Dictionary to register the plugins for a client it does not make sense ensure that all the plugin will run in order I think as it is not a guarantee as any thread can register them.

If this feature is required anytime I think we can enforce to a Dictionary with a Order and lock anytime a plugin is being added to ensure it is registered in order and will be executed in order was well.

For the moment I think is best keep it simple until some need that.

What do you think ? @serkantkaraca

Also renamed FirstSendPlugin just to SamplePlugin

This checklist is used to make sure that common guidelines for a pull request are followed.

  • I have read the contribution guidelines.
  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR.
  • The pull request does not introduce breaking changes (unless a major version change occurs in the assembly and module).
  • If applicable, the public code is properly documented.
  • Pull request includes test coverage for the included changes.
  • The code builds without any errors.

@serkantkaraca serkantkaraca merged commit 13c0e83 into Azure:dev Oct 18, 2018
@davidrevoledo davidrevoledo deleted the devRemovePluginTest branch November 12, 2018 22:39
hmlam pushed a commit that referenced this pull request Feb 15, 2019
* Use Azure Storage Account NameValidator to check LeaseContainerName (#327)

* Create EventHubsTimeoutException for consistency (#328)

* Mark readonly fields, complete cancellation token and remove useless Where in LINQ (#326)

* Implementing Plugins for EventHub (#324)

* Implement Plugin to Process each event when client is sending telemetry

*  Microsoft copyright header

* Fix Typo

* Changes for #324 (review)

* Implement AfterEventsReceive for EventHubsPlugin

* Implement Plugin Tests

* Sort usings

* changes for #324 (comment)

* Fix Resources

* Changes for #324 (review)

* Change for #324 (comment)

* Move Using to Namespace block

* Copy Plugins for InnerSender in AmqpEventHubClient (#329)

* Prevent event data being over writed when multiple plugins called (#330)

* Parallelize expired lease check in processor host (#333)

* Parallelize expired lease check

* -

* Remove unit test and rename FirstPlugin (#335)

* Using Lazy instead of static initialization for ExceptionUtility  (#337)

* Using Lazy instead of static initialization

* Use default ctor

* Complete Missing CancellationToken (#338)

* Fix LazyLoad Ctor (#341)

* Nullify Task when The Stop is complete (#342)

* Nullfy Task when The Stop is complete

* Test for Re Register event processor

* Reset CancellationTokenSource

* Replace Locks in AmqpEventHubClient and Code Clean ups in AmqpEventHubClient (#345)

* Replace Double lock patterns by using Lazy

* Code CleanUps in AmqpEventHubClient

* Check client management address when it is being created

* Remove Result for AzureStorageCheckpointLeaseManager GetAllLeases (#346)

* Remove Result for async call

* Get awaiter get result for GetAllLeases

* Remove useless using

* Remove useless initializator

* Replace Task Run Call

* Remove Task Run

* Fix Tests Moving Lazy initialization at the top of the ctor (#347)

* Max message size is 1MB now. Updating the test accordingly. (#344)

* Use Guard Class to improve code legibility and avoid lines (#339)

* Using Guard to improve code reading and avoid lines

* Using ArgumentNotNullOrEmpty

* Complete More validations with Guard

* Replace All ArgumentNullException

* Fix Namespace

* Change a few expecting exceptions (#351)

* Code CleanUps in Primitives / General (#350)

* EventHubCode Clean ups

* Code CleanUps in Primitives

* Rename variable

* Leave string cast

* Some Code Cleanups in Ampq Implementation (#349)

* Omit failures in receive pump (#354)

* Clean more results in sync context (#348)

* Clean more results in sync context

* Order using

* Changes for #348 (review)

* Remove using

* Support partition-empty in runtime metrics (#352)

* Adding partition IsEmpty support to runtime metrics

* Use AMQP client constants

* Move to correct name

* is_partition_empty is the correct name

* Reduce the number of storage calls in lease manager (#357)

* Couple improvements in Azure Lease Manager to reduce numberof storage calls.

* N/A as partition id

* Go with default timeout

* Moving to most recent AMQP release

* Fix flaky EPH test

* Adding 30 seconds default operation timeout back to tests.

* Reducing EPH to storage IO calls.

* Couple more fixes

* .

* Set token for owned leases.

* Refresh lease before acquiring in processor host.

* Fix metada removal order during lease release.

* Update lease token only for already running pumps to avoid resetting receiver position data.

* FetchAttributesAsync of blob as part of GetAllLeasesAsync() call.

* Refresh lease before attempting to steal

* Don't retry if we already lost the lease during receiver open.

* Don't attempt to steal if owner has changed from the calculation time to refresh time.

* -

* Partition pump to close when hit ReceiverDisconnectedException since this is not recoverable.

* -

* Ignore any failure during releasing the lease

* Don't update pump token if token is empty

* Nullify the owner on the lease in case this host lost it.

* Increment ourLeaseCount when a lease is acquired.

* Correcting task list

* No need to assign pump lease token to downloaded lease.

* comment update

* comment update

* Clear ownership on partial acquisition.

* Clear ownership on partial acquisition.

* Make sure we don't leave the lease as owned if acquisition failed.

* Adding logs to debug lease corruption bug

* Adding logs to debug lease corruption bug

* Small fix at steal lease check

* Protect subject iterator variable during task creation in for loops.

* .

* Renew lease right after ChangeLease call

* Don't create pump if partition expired or already moved to some other host.

* Use refreshed lease while creating partition pump.

* Remove temporary debug logs.

* Addressing SJ's comments

* Remove obsolete

* Moving AD SDK 4.5 and Xamarin.iOS10 support (#365)

* Making SystemProperties public addressing testability issues. (#332)

* Provide batch object's event data enumerator publicly. (#356)

* Bumping up the SDK version (#366)

* ServiceFabricProcessor preview (#262)

This is the code that built and released as preview version 0.5.2 https://www.nuget.org/packages/Microsoft.Azure.EventHubs.ServiceFabricProcessor/0.5.2

At the time it couldn't be merged with dev due to test issues from unrelated work, so we did the release from the SFprocessor branch. Those issues have been resolved, and we expect that future preview releases will come from dev branch.

* Client changes to support SFP (#367)

Three changes in the client needed to support SFP or SFP testing:
1) A previous PR added the ability to set EventData.SystemProperties, but it is not much use without the ability to create a new SystemPropertiesCollection instance. SFP testing does not need to set individual values on a SystemPropertiesCollection, just create new instances with values that do not change after creation time, so I added a public constructor which sets all the values.
2) SFP was previously creating EventHubClients with connection strings, but there is no string syntax for setting the operation timeout, and the message pump feature on PartitionReceiver uses the operation timeout. The easiest way to let SFP set the operation timeout is to make public the existing EventHubClient.Create call which takes a ConnectionStringBuilder.
3) Originally, SFP was a friend assembly of the client, the same as EPH, but it was decided that that was not the best design. Supporting the EnableReceiverRuntimeMetric option requires the ability to create new ReceiverRuntimeInformation instances (made constructor public) and update the values from a received EventData. Copying the values in SFP code would require making a bunch of properties on EventData public get, and the corresponding properties on ReceiverRuntimeInformation public set. Instead, I added an Update method which takes an EventData and performs the copy within the client assembly so no visibility change is required. Also modified the EPH code to use the new Update method.

* delaysign=false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants